<?
if(isset($var_name) && isset($var_value)){
    if($var_name!="" && $var_value!=""){
	$file=file("/etc/zaptel.conf");
	$tmp=0;
	foreach($file as $i=>$ii){
	    if(preg_match("!^(#|//)!", $ii))continue;
	    if(preg_match("!$var_name!", $ii)){
		    array_splice($file, $i, 1,"$var_name=$var_value\n");
		    $tmp=1;	    
	    }
	}
	if($tmp==0){
		array_push($file, "$var_name=$var_value\n");
	}
	$f=@fopen("/etc/zaptel.conf", "w");
	foreach($file as $i)
	    @fwrite($f, $i);
	@fclose($f);
    }
}
?>